//
//  KnowMessageCell.m
//  HealthA段
//
//  Created by MrJXT on 15/6/6.
//  Copyright (c) 2015年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "KnowMessageCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation KnowMessageCell
- (void)dealloc
{
    [_authorLabel release];
    [_countLabel release];
    [_timeLAbel release];
    [_titleLabel release];
    [_picView release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.titleLabel];
        [_titleLabel release];
        
        self.countLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.countLabel];
        [_countLabel release];
        
        self.authorLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.authorLabel];
        [_authorLabel release];
        
        self.timeLAbel = [[UILabel alloc]init];
        [self.contentView addSubview:self.timeLAbel];
        [_timeLAbel release];
        
        self.picView = [[UIImageView alloc]init];
        [self.contentView addSubview:self.picView];
        [_picView release];
    }
    return self;
}

//试图布局
-(void)layoutSubviews
{
    [super layoutSubviews];
    
    self.picView.frame = CGRectMake(5, 5, 100, 120);
    self.picView.layer.borderWidth = 5;
    self.picView.layer.cornerRadius = 18;
    self.picView.layer.masksToBounds = YES;
    self.picView.layer.borderColor = [UIColor clearColor].CGColor;
    
    self.titleLabel.frame = CGRectMake(120, 5, WIDTH - 120, 40);
    self.titleLabel.numberOfLines = 0;
    [self.titleLabel sizeToFit];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.layer.borderWidth = 2;
    self.titleLabel.layer.cornerRadius = 10;
    self.titleLabel.layer.masksToBounds = YES;
//    self.titleLabel.backgroundColor = [UIColor grayColor];
//    self.titleLabel.alpha = 0.36;
    self.titleLabel.font = [UIFont systemFontOfSize:17];
    self.titleLabel.layer.borderColor = [UIColor clearColor].CGColor;
    
    self.countLabel.frame = CGRectMake(120, 60, 200, 40);
    self.countLabel.alpha = 0.63;
    self.countLabel.font = [UIFont systemFontOfSize:14];
//    self.authorLabel.frame = CGRectMake(170, 30, WIDTH - 170, 30);
    
    self.timeLAbel.frame = CGRectMake(120, 90, WIDTH - 120, 40);
    self.timeLAbel.alpha = 0.63;
    self.timeLAbel.font = [UIFont systemFontOfSize:14];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
